package com.keguoyu.easymvp.ioc

import com.android.build.gradle.AppExtension
import com.android.build.gradle.AppPlugin
import com.keguoyu.easymvp.ioc.origin.InvokerTransform
import org.gradle.api.Plugin
import org.gradle.api.Project

class InvokerPlugin : Plugin<Project> {

  override fun apply(project: Project) {
        println("apply origin invoker plugin")
        val isApp = project.plugins.hasPlugin(AppPlugin::class.java)
        if (isApp) {
            val android = project.extensions.getByType(AppExtension::class.java)
            android.registerTransform(InvokerTransform(project))
        }
  }

}